import java.util.Arrays;
import java.util.Scanner;

/**
 * @author: gao
 * @create-date: 2025/4/5 22:27
 */

public class Solution {
    public int[] sortArray(int[] nums) {
        MergeSort(nums, 0, nums.length - 1);
        return nums;
    }

    private void MergeSort(int[] nums, int left, int right) {
        if (left >= right) return;

        //根据中间点划分左右子数组
        int mid = (left + right) / 2;
        MergeSort(nums, left, mid);
        MergeSort(nums, mid + 1, right);

        //合并两个有序数组
        int[] tmp = new int[right - left + 1];
        int p1 = left, p2 = mid + 1, i = 0;
        while (p1 <= mid && p2 <= right) {
            tmp[i++] = (nums[p1] <= nums[p2]) ? nums[p1++] : nums[p2++];
        }
        while (p1 <= mid) {
            tmp[i++] = nums[p1++];
        }
        while (p2 <= right) {
            tmp[i++] = nums[p2++];
        }

        //还原
        for (int j = left; j <= right; j++) {
            nums[j] = tmp[j - left];
        }
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while(in.hasNextInt()){
            int len = in.nextInt();
            int[] nums = new int[len];
            for (int i = 0; i < len; i++) {
                nums[i] = in.nextInt();
            }
            Solution solution = new Solution();
            int[] ret = solution.sortArray(nums);
            System.out.println(Arrays.toString(nums));
        }
    }
}